home *** CD-ROM | disk | FTP | other *** search
-
-
-
- RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++)))) RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
-
-
-
- NNNNaaaammmmeeee
- RWTPtrMultiSetIterator<T,C> - Rogue Wave library class
-
- SSSSyyyynnnnooooppppssssiiiissss
- #include<rw/tpmset.h>
-
-
-
- RWTPtrMultiSet<T,C> set;
- RWTPtrMultiSetIterator<T,C> itr(set);
-
- SSSSttttaaaannnnddddaaaarrrrdddd CCCC++++++++ LLLLiiiibbbbrrrraaaarrrryyyy DDDDeeeeppppeeeennnnddddeeeennnntttt!!!!
- RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr requires the Standard C++ Library.
-
-
- DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
- RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr is supplied with Tools 7 to provide an iterator
- interface to the new Standard Library based collections that has backward
- compatibility with the container iterators provided in Tools 6. The order
- of iteration over an RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeetttt is dependent upon the comparator
- object parameter CCCC as applied to the values stored in the container. The
- current item referenced by this iterator is undefined after construction
- or after a call to rrrreeeesssseeeetttt(((()))). The iterator becomes valid after being
- advanced with either a preincrement or ooooppppeeeerrrraaaattttoooorrrr(((()))). For both ooooppppeeeerrrraaaattttoooorrrr++++++++
- and ooooppppeeeerrrraaaattttoooorrrr(((()))), iterating past the last element will return a value
- equivalent to boolean ffffaaaallllsssseeee. Continued increments will return a value
- equivalent to ffffaaaallllsssseeee until rrrreeeesssseeeetttt(((()))) is called.
-
- PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
- None
-
- EEEExxxxaaaammmmpppplllleeeessss
- #include<rw/tpmset.h>
-
-
-
- #include<iostream.h>
- #include<rw/cstring.h>
-
-
- int main(){
-
-
-
- RWTPtrMultiSet<RWCString, less<RWCString> > a;
- RWTPtrMultiSetIterator<RWCString, less<RWCString> > itr(a);
-
-
- a.insert(new RWCString("John"));
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++)))) RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
-
-
-
- a.insert(new RWCString("Steve"));
- a.insert(new RWCString("Mark"));
- a.insert(new RWCString("Steve"));
-
-
- for(;itr();)
-
-
-
- cout << *itr.key() <<endl;
-
-
-
- return 0;
-
-
-
- }
- Program Output
- John
- Mark
- Steve
-
- PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
- Steve
-
-
-
- RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr<<<<TTTT,,,,CCCC>>>>(const RWTPtrMultiSet<T,C>& m);
-
-
- Creates an iterator for the multi-set mmmm. The iterator begins in an
- undefined state and must be advanced before the first element will be
- accessible
-
- PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr OOOOppppeeeerrrraaaattttoooorrrrssss
- T*
- ooooppppeeeerrrraaaattttoooorrrr(((())))();
-
-
- Advances self to the next element, dereferences the resulting iterator
- and returns its value. If the iterator has advanced past the last item
- in the container, the element returned will be a nnnniiiillll pointer equivalent
- to boolean ffffaaaallllsssseeee.
-
- RWBoolean
- ooooppppeeeerrrraaaattttoooorrrr++++++++();
-
-
- Advances self to the next element. If the iterator has been reset or
- just created self will now reference the first element. If, before
- iteration, self referenced the last association in the multi-set, self
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++)))) RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
-
-
-
- will now point to an undefined value and a value equivalent to ffffaaaallllsssseeee will
- be returned. Otherwise, a value equivalent to ttttrrrruuuueeee is returned. Note: no
- post-increment operator is provided.
-
- PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
- RWTPtrMultiSet<T,C>*
- ccccoooonnnnttttaaaaiiiinnnneeeerrrr(((()))) const;
-
-
- Returns a pointer to the collection being iterated over.
-
- T*
- kkkkeeeeyyyy();
-
-
- Returns the stored value referenced by sssseeeellllffff. Undefined if self is not
- referencing a value within the list.
-
- void
- rrrreeeesssseeeetttt();
- void
- rrrreeeesssseeeetttt(RWTPtrMultiSet<T,C>& h);
-
-
- Resets the iterator so that after being advanced it will reference the
- first element of the collection. Using rrrreeeesssseeeetttt(((()))) with no argument will
- reset the iterator on the current container. Supplying a RRRRWWWWTTTTPPPPttttrrrrMMMMuuuullllttttiiiiSSSSeeeetttt
- with rrrreeeesssseeeetttt(((()))) will reset the iterator on that container.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-